package com.example.demo;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonParser;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.impl.util.json.JSONObject;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.DeploymentBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ActiviController {
    public static ApplicationContext applicationContext;
    @Autowired
    RepositoryService repositoryService;
    @Autowired
    RuntimeService runtimeService;
@GetMapping(value = "/index")
    public String index()
{
    Deployment deployment = repositoryService.createDeployment().name("test1").addClasspathResource("tu/test1.bpmn").deploy();
    System.out.println("已部署ID"+deployment.getId()+"已部署名称"+deployment.getName());
    //return JSON.toJSONString(applicationContext.getBeanDefinitionNames());
    return JSON.toJSONString(deployment);
}
/*
* 参考地址
* https://blog.csdn.net/ZYC88888/article/details/84305768
*https://www.activiti.org/userguide/
*https://blog.csdn.net/fanxiangru999/article/details/79381966
*https://www.cnblogs.com/lyh421/p/6478849.html
* */
}
